import request from '@/utils/request'

// 查询设备站点列表
export function listStation(query) {
  return request({
    url: '/ems/station/list',
    method: 'get',
    params: query
  })
}

// 查询设备站点详细
export function getStation(id) {
  return request({
    url: '/ems/station/' + id,
    method: 'get'
  })
}

// 新增设备站点
export function addStation(data) {
  return request({
    url: '/ems/station',
    method: 'post',
    data: data
  })
}

// 修改设备站点
export function updateStation(data) {
  return request({
    url: '/ems/station',
    method: 'put',
    data: data
  })
}

// 删除设备站点
export function delStation(id) {
  return request({
    url: '/ems/station/' + id,
    method: 'delete'
  })
}


// 查询站点设备
export function getStationDevices(id) {
  return request({
    url: '/ems/station/getStationDevices/' + id,
    method: 'get'
  })
}

// 绑定设备站点
export function addBindingDevices(params) {
  return request({
    url: '/ems/station/addBindingDevices',
    method: 'put',
    data:params
  })
}

// 解除设备绑定站点
export function remBindingDevice(params) {
  return request({
    url: `/ems/station/remBindingDevice/${params.stationId}/${params.id}`,
    method: 'delete'
  })
}

// 设置站点默认显示设备
export function defaultDisplayDevice(params) {
  return request({
    url: `/ems/station/defaultDisplayDevice/${params.id}/${params.deviceId}`,
    method: 'put'
  })
}
